# encoding:utf-8
# desc:
# python2 下gil会释放 total 打印是 一个不固定的
# python3 作了优化，应该是3.6以后作的优化
total = 0

def add():
    global total
    for i in range(100000000000):
        total += 1
def desc():
    global total
    for i in range(100000000000):
        total -= 1

import threading
thread1 = threading.Thread(target=add)
thread2 = threading.Thread(target=desc)
thread1.start()
thread2.start()

thread1.join()
thread2.join()
print(total)


